﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="LotteryResult.aspx.cs" Inherits="LotteryVote.LotteryResult" %>

<asp:Content ID="Header" ContentPlaceHolderID="head" runat="server">
    <script src="JS/jquery.ui.core.min.js" type="text/javascript"></script>
    <script src="JS/jquery.ui.datepicker.min.js" type="text/javascript"></script>
    <script src="JS/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
    <link href="UI/start/jquery.ui.datepicker.css" rel="stylesheet" type="text/css" />
    <link href="Style/TableBaseStyle.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        table
        {
            width: 25%;
            float: left;
            padding: 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="main" runat="server">
    <div id="searchBar">
        <span>
            <%=GetGlobalResourceObject("Resource","Date") %>:</span>
        <asp:TextBox ID="txt_date" runat="server"></asp:TextBox>
        <asp:Button ID="btn_search" runat="server" Text="<%$Resources:Resource,Search %>"
            OnClick="btn_search_Click" />
        <asp:Button ID="btn_today" runat="server" Text="<%$Resources:Resource,Today %>" OnClick="btn_today_Click" />
        <asp:Button ID="btn_yesterday" runat="server" Text="<%$Resources:Resource,Yesterday %>"
            OnClick="btn_yesterday_Click" />
        <%if (CurrentUser.Role == LotteryVote.Entity.SystemRole.Company)
          { %>
        <input type="button" id="addLotterResult" value='<%=GetGlobalResourceObject("Resource","AddLotteryResult") %>' />
        <%} %>
    </div>
    <asp:Repeater ID="rpt_LotteryResults" runat="server">
        <ItemTemplate>
            <table cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                        <td colspan="2">
                            (<%#Eval("Company.Region").ToString().Substring(0,1)%>)<%#Eval("Company.Name")%>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="rpt_innerResult" runat="server" DataSource='<%#Eval("Records") %>'>
                        <ItemTemplate>
                            <tr>
                                <td style="width: 30%">
                                    <%#Container.ItemIndex+1 %>
                                </td>
                                <td>
                                    <%#Eval("Value")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%=txt_date.ClientID %>").attr("readonly", "readonly").datepicker();
            $("#addLotterResult").bind("click", function () {
                buildFrame("addLotteryResult", 500, 990, "AddTodayLotteryResult.aspx");
            });
        });
    </script>
</asp:Content>
